<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="name"><input type="text" v-model="id"><button @click="add">添加</button>
        <ul>
            <li v-for="item in arr" :key="item.id">
                <input type="checkbox">{{item.name}}
            </li>
        </ul>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                arr: [
                    { 
                       id: 0,
                        name: '张三'
                    },
                    { 
                       id: 1,
                        name: '李四'
                    }
                ],
                name: '',
                id: ''
            },

            methods: {
                add() {
                   this.arr.unshift({
                       name: this.name,
                       id: this.id
                   }) 
                }
            }
        })
    </script>
</body>
</html>